Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development


The attribute control and the object type control

Although this chapter does not go into a detailed discussion of how attributes are created, there are a few basic pieces of information concerning attributes that are important to mention here.

First, every attribute in Progress Dynamics is defined in the Repository database. Attributes can be added and edited using the Attribute Maintenance window on the Progress Dynamics Development window’s Attribute menu. Figure 3–7 shows the definition of the ShowPopup attribute.

Figure 3–7: Attribute Maintenance window

There are a few key things to note about this definition that will help you understand how you can modify attribute values.

The Constant Level defines the lowest level of the attribute hierarchy at which a value can be defined for the attribute. This can be:

There are five toggle boxes on the window that also help identify where and how you can change the attribute value:

Thus, you see that many attributes used internally are not displayed in the property sheet for a variety of reasons.

The Lookup Type drop-down list lets you define the way in which the attribute is edited in the Dynamic property sheet and includes the following types:

There are other limits in defining and using attributes. One important characteristic of an attribute that is not defined in the Attribute Maintenance window is its initial value. This is because attributes are not given values until they are associated with a class. You do this in the Object Type Control window under the Dynamic Development window’s Object menu. This tree view-based window shows all the Object classes in a hierarchy starting with Base, which represents the smart class common to all SmartObjects. Attributes are defined for each class, so an individual object inherits attributes and their initial values from all the classes in its branch of the hierarchy.

Figure 3–8 shows an example of drilling down through the DynView class to locate the FrameMinHeightChars attribute.

Figure 3–8: Object Type Maintenance window

The organization of the hierarchy is not entirely accurate for all objects. Some classes such as AppServer are optional parts of other classes, but the TreeView does not represent this option. This is why to locate the DynView class, you expand the Base class, then AppServer, then Visual, then Container (again optional, as a viewer can be a container if it has SmartDataFields such as dynamic lookups and combos in it), then DataVisual, then viewer. This is where you define the default value, if any, for an attribute as used in that class.

It is important to understand that every attribute you use in an object must be defined for the object type at this class level. You cannot simply add an attribute to a single object or a single instance of an object. So when, for example, we described adding an attribute value record for a DataField in the Repository Maintenance tool, this was because attribute values are stored at that level only if they override the default values for the class. So when you add an attribute value record, it must be for an attribute that is defined for one of the classes the object inherits from.

Obviously, all the attributes that are needed to provide all the standard behavior for all the objects in the framework are predefined in the Repository, and in principle, you are likely never to need to use these tools. However, if you define your own objects or create a subclass of an existing object, you can add new attributes that your application needs the objects to have.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095